﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;

/// <summary>
/// Summary description for DataReaderFactory
/// </summary>
public abstract class DataReaderFactory
{
    //private string connectionString;
    private static IDataReaderFactory dbrInstance;

	public DataReaderFactory()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public static IDataReaderFactory GetDBReaderInstance(string ConnectionStringName, string DBType)
    {
        if (DBType == "MySQL")
        {
            dbrInstance = MySQLDBReader.GetDBReaderInstance(ConnectionStringName);
        }
        else
        {
            dbrInstance = DBReader.GetDBReaderInstance(ConnectionStringName);
        }

        return dbrInstance;
    }
    
}

public interface IDataReaderFactory
{
    DataTable GetDataTable(string StoredProcedureName, CommandType cmdType, params MyDBParameter[] parameter);
    int ExecuteNonQuery(string StoredProcedureName, CommandType cmdType, params MyDBParameter[] parameter);
    object ExecureScalar(string StoredProcedureName, CommandType cmdType, params MyDBParameter[] parameter);
}